package com.jmemoir.base.validation.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;

/**
 * 用户DTO
 *
 * @author Tellsea
 * @date 2023/8/2
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDTO {

    @NotNull(message = "id不能为空")
    private Long id;

    @NotBlank(message = "用户名不能为空且不能包含空格")
    private String userName;

    @NotEmpty(message = "用户昵称不能为空")
    private String nickName;

    @Email(message = "必须是有效的电子邮件地址")
    private String email;

    @Min(value = 1, message = "年龄必须大于或等于1")
    @Max(value = 100, message = "年龄必须小于或等于100")
    private Integer age;
}